{% extends "base_weblog.html" %}

{% block title %}Comentários recentes{% endblock %}

{% block billboard %}<h2>Comentários do site</h2>{% endblock %}

{% block extrahead %}
  <link rel="alternate" type="application/rss+xml" title="Comentários (RSS)" href="/feeds/rss/comments/">
{% endblock %}

{% block content-main %}
<div class="limite">
    <h1>Comentários recentes</h1>
    
    <div class="pagination pag-top">
	{% if has_previous %}
	<a href="?page={{ previous }}" class="previous">Anterior</a> |
	{% endif %}
	Página {{ page }} de {{ pages }}
	{% if has_next %}
	| <a href="?page={{ next }}" class="next">Próxima</a>
	{% endif %}
    </div>

    {% for comment in object_list %}
    <div class="comment clearfix" id="c{{ comment.id }}">
	<h3>
	    <a href="{{ comment.get_absolute_url }}">
		{{ comment.user_name|escape }}
		<span>
		    ({{ comment.submit_date|date:"F j, Y" }} às {{ comment.submit_date|date:"P" }})
		</span>
	    </a>
	</h3>
	{{ comment.comment|escape|urlizetrunc:"40"|linebreaks }}

	{% if perms.comments.delete_comment %}
	<form action="/admin/comments/comment/{{ comment.id }}/delete/" method="post">
	<fieldset>
	    <legend>Deletar comentário</legend>
	    <input type="hidden" name="post" value="yes" />
	    <input type="hidden" name="next" value="/comments/" />
	    <button type="submit" value="Deletar">Deletar</button>
	</fieldset>
	</form>
	{% endif %}
    </div>
    {% endfor %}
    
    <div class="pagination">
	{% if has_previous %}
	<a href="?page={{ previous }}" class="previous">Anterior</a> |
	{% endif %}
	Página {{ page }} de {{ pages }}
	{% if has_next %}
	| <a href="?page={{ next }}" class="next">Próxima</a>
	{% endif %}
    </div>
</div>
{% endblock %}
